<%-- 
    Document   : view_akademikLengkap
    Created on : Jan 19, 2014, 4:00:19 AM
    Author     : Muhammad Dony
--%>

<%@page import="java.util.ArrayList"%>
<%@page import="java.util.List"%>
<%@page import="data.IdentitasData"%>
<%@page import="data.AkademikData"%>
<%@page import="database.IdentitasDB"%>
<%@include file="../Admin/header_admin.jsp" %>
<script src="res/js/jquery.dataTables.js"></script>
<script src="res/js/bootstrap.dataTables.js"></script>
<link href="res/css/dataTables.css" type="text/css"/>
<style>.pagination{margin:0}</style>

<div class="row">
    <div class="col-lg-6 col-lg-push-1">
        <h3>Daftar Penerima Beasiswa</h3>
        <table id="table" cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered">
            <thead>
            <th>No</th>
            <th>Semester</th>
            <th>IPS</th>
            <th>IPK</th>
            </thead>
            <tbody>
                <%
                    List listakademik = (List) request.getAttribute("listakademik");
                    double[][] IPS = new double[2][8];
                    int n = 1;
                        for (int j = 0; j< listakademik.size(); j++) {
                            AkademikData akademik = (AkademikData) listakademik.get(j);
                            IPS[0][j] = Double.parseDouble(akademik.getIPS());
                            IPS[1][j] = Double.parseDouble(akademik.getIPK());
            %>
                <tr>
                    <td><%=n++%></td>
                    <td><%=akademik.getSemester()%></td>
                    <td><%=IPS[0][j]%></td>
                    <td><%=IPS[1][j]%></td>
                </tr>
                <%         
                    }%>
            </tbody>
        </table>
             <div id="chart_div" style="width: 900px; height: 500px;"></div>
    </div>
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      google.load("visualization", "1", {packages:["corechart"]});
      google.setOnLoadCallback(drawChart);
      function drawChart() {
                 
        var data = google.visualization.arrayToDataTable([
        ['Semester', 'IPS',   'IPK'],
            <% 
            for (int a = 1; a<= listakademik.size(); a++) {
            %>
            ['Semester <%=a%>',         <%=IPS[0][a-1]%>,   <%=IPS[1][a-1]%>],
          <%  }%>
        ]);

        var options = {
          title: 'Grafik Perkembangan Akademik',
          hAxis: {titleTextStyle: {color: '#333'}},
          vAxis: {minValue: 0}
        };

        var chart = new google.visualization.AreaChart(document.getElementById('chart_div'));
        chart.draw(data, options);
      }
    </script>

</div>
<%@include file="../Admin/footer_admin.jsp" %>